import  DataFun from "./DataFun.js"


const Foo = {
    foo() { console.log('foo') }
};
function mixins(...list) {
    return function (target) {
        Object.assign(target.prototype, ...list)
    }
}

@mixins(Foo)
class Math {
    constructor(a, b){
        this.ss=1;
        this.add(1,2)
        this.init();
    }
    @DataFun
    init(){

    }
    add(a, b) {
        console.log("执行add")
        return a + b;
    }
}


function log(target, name, descriptor) {
    var oldValue = descriptor.value;

    descriptor.value = function() {
        console.log(`Calling ${name} with`, arguments);
        return oldValue.apply(this, arguments);
    };

    return descriptor;
}

const math = new Math();

// passed parameters should get logged now
math.add(2, 4);

math.foo()
